<form action="color.php" method="POST" >
Pls input color code: #<input type=text size=100 name="colorCode" />
<input type=submit value="submit" />
</form>
<?php

if(isset($_POST['colorCode']) && $_POST['colorCode'] != Null && $_POST['colorCode'] != "")
{
    echo "<div style='background:#{$_POST['colorCode']};width:100%;height:20px'>#{$_POST['colorCode']}</div>";
} 
?>
